Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message when there is no language server installed for the current language #413

Merged
merged 1 commit into from
Dec 12, 2020
Merged

Conversation

martinRenou
Copy link
Member

When there is no language server installed, it fails with

TypeError: Path must be a string. Received null

Which is not very easy to understand without looking into the code. This PR makes it fail with a nicer error message that tells what is wrong.

for when there is no language server installed for the current language

Signed-off-by: martinRenou <[email protected]>
@krassowski
Copy link
Member

Would this show up in the status bar or in the developer console? This is probably a thing that we would want to have a test for. I am short on time a few days more but otherwise happy to help with writing the robot test for it.

@martinRenou
Copy link
Member Author

Would this show up in the status bar or in the developer console?

In the developer console

@bollwyvl
Copy link
Collaborator

Our console output is noisy to the point of being useless... if this is a big problem, should we see about integrating with the in-UI log output?

@martinRenou
Copy link
Member Author

should we see about integrating with the in-UI log output?

That would be a big improvement for people who don't know how to open the dev tools (most JupyterLab users I guess), so they get an idea why it does not work.

@krassowski
Copy link
Member

I just got bitten by this error when opening .gitignore file, for me it was leading to:

TypeError: Cannot read property 'replace' of null
    at url.js:61
    at Array.map (<anonymous>)
    at Object.join (url.js:61)
    at Function.solve_uris (connection_manager.ts:335)
    at DocumentConnectionManager.connect_socket (connection_manager.ts:131)
    at DocumentConnectionManager.connect (connection_manager.ts:282)
    at FileEditorAdapter.connect (adapter.ts:490)
    at FileEditorAdapter.connect_document (adapter.ts:324)
    at new FileEditorAdapter (file_editor.ts:55)
    at WidgetAdapterManager.connectWidget (adapter_manager.ts:66)

Anyways, merging as is and I will iterate to add some indication of this in the UI.

@krassowski krassowski merged commit e2b95e3 into jupyter-lsp:master Dec 12, 2020
@krassowski
Copy link
Member

Thank you @martinRenou!

@martinRenou martinRenou deleted the better_error_message branch December 14, 2020 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants